package com.ruoyi.job.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.job.domain.SysJobMonitor;
import com.ruoyi.job.service.ISysJobMonitorService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 调度监控
 *
 * @author RuoYi
 */
@RestController
@RequestMapping("/job/monitor")
@RequiredArgsConstructor
public class SysJobMonitorController extends BaseController {

    private final ISysJobMonitorService jobMonitorService;

    /**
     * 查询定时任务调度队列列表
     */
    @RequiresPermissions("monitor:jobMonitor:list")
    @GetMapping("/list")
    public TableDataInfo list(SysJobMonitor jobMonitor) {
        startPage();
        List<SysJobMonitor> list = jobMonitorService.selectList(jobMonitor);
        return getDataTable(list);
    }
}
